<template>
	<view class="container padding-top-sm">
		<view class="bg-white margin-top-sm">
			<view class="solid-bottom text-13 flex justify-between align-center padding">
				<view class="text-333 flex-sub text-bold" style="flex: 2;"> 联系人或快递公司 </view>
				<input type="text" v-model="contactName" value="" class="text-13 flex-treble"
					placeholder="联系人或快递公司" />
			</view>
			<view class="solid-bottom text-13 flex justify-between align-center padding">
		        <view class="text-333 flex-sub text-bold" style="flex: 2;"> 联系人电话或快递单号 </view>
				<input type="text" v-model="contactNo" value="" class="text-13 flex-treble"
					placeholder="联系人电话或快递单号" />
			</view>
			
	</view>
		<view class="padding">
			<button class="btn" @click="submit">提交</button>

		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
			     contactNo:'',
				 contactName:'',
				 id:''
				
			}
		},
		onLoad(options) {
		    if(options.id){
				this.id = options.id
			}
		},
		methods: {
			async submit(){
				 if(!this.contactName){
					 return this.$util.msg('请输入联系人或快递公司')
				 }
				 if(!this.contactNo){
					 return this.$util.msg('请输入联系人电话或快递单号')
				 }
				 const data ={orderId:this.id,contactName:this.contactName,contactNo:this.contactNo}
				 const [err,rs] = await this.$get(this.$api.updateToPosted,data)
				 if(rs){
					 this.$util.msg(rs.message)
					 setTimeout(function(){
						 uni.navigateBack({
						 	
						 })
					 },1000)
				 }
			 }
		}
	}
</script>

<style scoped>
	.btn {
		background: linear-gradient(90deg, #F16347, #EE0979);
		padding: 20rpx 0;
		color: #fff;
		margin-top: 60rpx;
		font-size: 28rpx;
	}
</style>
